<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of KTDFunctionalTest
 *
 * @author Gael
 */
class KTDTestFunctional extends sfTestFunctional {
   public function loadData(){
       $this->info("Chargement des donnees...");
       $this->setTester('doctrine', 'sfTesterDoctrine');
       Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures');
       return $this;
   }
   public function auth($login, $password){
       $this->get("/joueur/se_connecter.html")->
        click("Rejoindre", array("signin" => array(
                                    "username" => $login,
                                    "password" => $password)))->
        with("form")->
               hasErrors(0);
       return $this;
   }
   public function setActualCharacterId($id, $username){
       /*Cette fonction sert juste à modifier de manière brute le personnage actuel pour les tests.*/
       $q = Doctrine_Query::create();
       $q->update("sfGuardUser u")->
               set("u.actual_character_id", $id)->
               where("u.username = ?", $username);

       $q->execute();
       return $this;
   }
}
?>
